package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.CompanyInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import com.lst.tools.mybatis.entity.DeleteBaseModel;

/**
 * 公司信息
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_company_info")
@ApiModel(value = "公司信息")
public class CompanyInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String COMPANY_NAME = "company_name";
    public static final String COMPANY_TYPE_ID = "company_type_id";
    public static final String COMPANY_TYPE_OTHER = "company_type_other";
    public static final String BUSINESS_PLACE_ID = "business_place_id";
    public static final String BUSINESS_PLACE_RENT = "business_place_rent";
    public static final String BUSINESS_LICENSE_STATUS = "business_license_status";
    public static final String ESTABLISH_AT = "establish_at";
    public static final String INDUSTRY_TYPE_ID = "industry_type_id";
    public static final String MONTH_TURNOVER_AMOUNT = "month_turnover_amount";
    public static final String ANNUAL_TAX_AMOUNT = "annual_tax_amount";
    public static final String ANNUAL_INVOICE_AMOUNT = "annual_invoice_amount";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "companyName", value = "公司名称", dataType = "String")
    @TableField(value = COMPANY_NAME)
    private String companyName;

    @ApiModelProperty(name = "companyTypeId", value = "公司类型", dataType = "Long")
    @TableField(value = COMPANY_TYPE_ID)
    private Long companyTypeId;

    @ApiModelProperty(name = "companyTypeOther", value = "公司其他类型", dataType = "String")
    @TableField(value = COMPANY_TYPE_OTHER)
    private String companyTypeOther;

    @ApiModelProperty(name = "businessPlaceId", value = "经营场所id", dataType = "Long")
    @TableField(value = BUSINESS_PLACE_ID)
    private Long businessPlaceId;

    @ApiModelProperty(name = "businessPlaceRent", value = "经营场租金", dataType = "Double")
    @TableField(value = BUSINESS_PLACE_RENT)
    private Double businessPlaceRent;

    @ApiModelProperty(name = "businessLicenseStatus", value = "营业执照   0:无   1:有", dataType = "String")
    @TableField(value = BUSINESS_LICENSE_STATUS)
    private String businessLicenseStatus;

    @ApiModelProperty(name = "establishAt", value = "成立日期", dataType = "Date")
    @TableField(value = ESTABLISH_AT)
    private Date establishAt;

    @ApiModelProperty(name = "industryTypeId", value = "单位类型", dataType = "Long")
    @TableField(value = INDUSTRY_TYPE_ID)
    private Long industryTypeId;

    @ApiModelProperty(name = "monthTurnoverAmount", value = "月营业额，单位元", dataType = "Double")
    @TableField(value = MONTH_TURNOVER_AMOUNT)
    private Double monthTurnoverAmount;

    @ApiModelProperty(name = "annualTaxAmount", value = "年纳税，单位元", dataType = "Double")
    @TableField(value = ANNUAL_TAX_AMOUNT)
    private Double annualTaxAmount;

    @ApiModelProperty(name = "annualInvoiceAmount", value = "年开票额，单位元", dataType = "String")
    @TableField(value = ANNUAL_INVOICE_AMOUNT)
    private Double annualInvoiceAmount;

    public CompanyInfo(long userId, String applyNo, CompanyInfoVo companyInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.companyName = companyInfoVo.getCompanyName();
        this.companyTypeId = companyInfoVo.getCompanyTypeId();
        this.companyTypeOther = companyInfoVo.getCompanyTypeOther();
        this.businessPlaceId = companyInfoVo.getBusinessPlaceId();
        this.businessPlaceRent = companyInfoVo.getBusinessPlaceRent();
        this.businessLicenseStatus = companyInfoVo.getBusinessLicenseStatus();
        this.establishAt = companyInfoVo.getEstablishAt();
        this.industryTypeId = companyInfoVo.getIndustryTypeId();
        this.monthTurnoverAmount = companyInfoVo.getMonthTurnoverAmount();
        this.annualTaxAmount = companyInfoVo.getAnnualTaxAmount();
        this.annualInvoiceAmount = companyInfoVo.getAnnualInvoiceAmount();
    }
}